<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Fly Prod</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link rel="stylesheet" type="text/css" href="default.css" />
        <script type="text/javascript" src="scripts.js"></script>
    </head>
    <body>
        <div id="upbg"></div>
        <div id="outer">
            <?php
            include 'header.php';
            include 'login.php';
            include 'menu.php';
            include 'utils/RssParser.php'
            ?>
            <div id="contentAccueil" >
                <?php
                include_once 'connectBDD.php';
                
                
                $result = mysql_query("SELECT * FROM event where star_event='1'order by date_event asc limit 5 ");
                echo "<div class='blocGalerie'>";
                $i = 0;
                $html = '';
                while ($rows = mysql_fetch_assoc($result)) {
                    if ($i == 0) {
                        $premiereImg = $rows['flyer_path'];
                        $nom = $rows['name_event'];
                        $id = $rows['id_event'];
                    }
                    $html .= "
                            <a class='lienPetitFlyer' onmouseover=\"javascript:changeImage('" . $rows['flyer_path'] . "', '" . $rows['id_event'] . "', '" . $rows['name_event'] . "')\" href='detailEvenement.php?idEvent=".$rows['id_event']."' onmouseout='relanceTimer()'>
                                <div class='petitFlyer' name='flyer' id=" . $rows['id_event'] . " value='".$rows['name_event']."'>
                                    <img src='" . $rows['flyer_path'] . "'/>
                                </div>
                            </a>";
                    $i++;
                }
                //   $html .= "</div>";

                echo "<div class='bandeauGrandFlyer' id='grandFlyer'>
                        <a id='lienGrandFlyer' href='detailEvenement.php?idEvent=" . $id . "'>
                                <div class='grandFlyer' id='grand_Flyer' >
                                    <img src='$premiereImg' /><div>$nom</div>
                                </div>
                        </a>
                     </div>";
                echo "<div id='bandeauListeEvenement'>";
                echo $html;
                echo "</div>";
                
                include 'twitterChat.php';
                
                echo "</div>"; //fin bloc galerie
                
                echo "<div class='blocNews'>";

                echo "<div id='titreNews'>News</div>";
                $result = mysql_query("select * from news order by date_news desc limit 5");
                while ($rows = mysql_fetch_assoc($result)) {

                    $date = date_create($rows['date_news']);
                    $date = date_format($date, 'd-m-Y à H:i:s');

                    echo "
                                    <div class='news' id='news_" . $rows['id_news'] . "' >
                                        <div id='login_msg'>" . stripslashes($rows['title_news']) . "</div>
                                        <div class='heure_msg_comment'>$date</div>
                                        <div id='msg_content'>" . stripslashes($rows['content_news']) . "</div>
                                    </div>";
                }

                echo "</div>"; //fin bloc News
                
                
                //Récupération du flux rss
                $handle = fopen("http://www.mtv.fr/services/scenic/feeds/get/rss/mgid:hcx:content:mtv.fr:c75b32a0-a1c1-4ea5-9460-b42472f096d0/", "rb");
                $rssParser = new RssParser(stream_get_contents($handle));
                $xpath = "//item";
                $rssParser->parse($xpath);
                //fin du bloc RSS
                
                
                echo "<br style='clear:both'/>";

                mysql_free_result($result);
                
                
                ?>
                
            </div>
<?php
                include 'footer.php';
?>
        </div>
    </body>
</html>
